from django.contrib import admin
from django.urls import path
from django.urls import re_path, include
from django.views.static import serve
import xadmin
from django.conf import settings
from django.conf.urls.static import static

xadmin.autodiscover()

# version模块自动注册需要版本控制的 Model
from xadmin.plugins import xversion

xversion.register_models()

urlpatterns = [
    # path('admin/', admin.site.urls),ly_course_category
    path(r'xadmin/', xadmin.site.urls),
    re_path(r'media/(?P<path>.*)', serve, {"document_root": settings.MEDIA_ROOT}),
    path(r'home/', include('home.urls')),
    path(r'user/', include('user.urls')),
    path('course/', include("course.urls")),
    path('cart/', include("cart.urls")),
    path(r'ckeditor/', include('ckeditor_uploader.urls')),
    path('order/', include('order.urls')),
    path('coupon/', include('coupon.urls')),
    path('payments/', include('payments.urls')),
]
